﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using KuaiPanSDK;

namespace DemoSDk
{
    public partial class CallBack : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            KuaiPan sdk = new KuaiPan();
            sdk.Token = Session["oauth_token"].ToString();
            sdk.TokenSecret = Session["oauth_token_secret"].ToString();

            string oauth_verifier = Request.QueryString["oauth_verifier"];
            string oauth_token = Request.QueryString["oauth_token"];
            sdk.Token = Request.QueryString["oauth_token"];
            if (sdk.GetAccessToken())
            {
                Session["oauth_token"] = sdk.Token;
                Session["oauth_token_secret"] = sdk.TokenSecret;
                Response.Redirect("Demo.aspx");
            }
            else
            {
                Response.Write(sdk.ErrMsg);
            }
        }
    }
}